echo file_get_contents('template/header.html'); ?>
require('includes/db.php');
require('includes/settings.php');
displayTitle("Transfer Stage Registration");
session_start();
if (isset($_SESSION['stagdata_user_id'])) {
$commnumber = $_GET['commnumber'];
if (isset($_POST["submit"])) {
$commnumber = $_POST['commnumber'];
$username = $_POST['username'];
$aQuery = mysql_query ("SELECT * FROM stagdata_user where username='".$username."' or email='".$username."'");
if ($row = mysql_fetch_array($aQuery)) {
$name = $row['name'];
$email = $row['email'];
$username = $row['username'];
$to_stagdata_user_id = $row['id'];
$recipient = $email;
$mail_body = "Stag with commission number ".$commnumber." has been transferred to your account.
Please click on the following link to confirm this transfer of stag registration.
Click here to complete transfer";
$subject = $system_from_subject_prefix." stag register transfer confirmation";
$header = "From: ".$system_from_name." <".$system_from_email.">\r\n".'Content-Type: text/html; charset="iso-8859-1"\r\n';
mail($recipient, $subject, $mail_body, $header);
echo "Your transfer request has been started.
".$name." has been notified and will need to confirm transfer before the record transferred.
";
} else {
echo "Error: Usename or email does not exist, you can only transfer a stag to another registed user.
";
}
}
//The complicated Validation
?>
} else {
echo "Error: You are not logged in!";
}
?>
echo file_get_contents('template/footer.html'); ?>